package com.mercator.client.graph;

public class Edge<T extends Comparable<? super T>, N extends Node<T,? super N>> implements Comparable<Edge<T,N>>
{
    public N u;
    public N v;
    public int weight;

    public Edge(int w, N u, N v){
	this.weight = w;
	this.u = u;
	this.v = v;
    }
    
    public Edge(N u, N v){
	this.weight = 1;
	this.u = u;
	this.v = v;
    }

    public String toString(){
	return "[(" + u + "," + v +")," + weight + "]" ;

    }

    @Override
    public int compareTo(Edge<T,N> e) {
	if(this.weight < e.weight)
	    return -1;
	if(this.weight > e.weight)
	    return 1;
	return 0;
    }


}
